package com.china08.yxyapi.repository.mg.huixue;

import java.util.List;

import org.springframework.data.mongodb.repository.MongoRepository;

import com.china08.yxyapi.entity.mg.huixue.YxyHuixuePlanKnowTrain;

public interface YxyHuixuePlanKnowTrainRepository extends MongoRepository<YxyHuixuePlanKnowTrain, String> {

    List<YxyHuixuePlanKnowTrain> findByStudentIdAndPlanId(String studentId, String planId);

    List<YxyHuixuePlanKnowTrain> findByStudentIdAndPlanIdAndBookContents(String studentId, String planId,
            String charId);

    /**
     * 根据学生id,计划id,知识点id查询该知识点练习次数
     *
     * @param studentId
     *            the student id
     * @param planId
     *            the plan id
     * @param knowId
     *            the know id
     * @return the long
     */
    Long countByStudentIdAndPlanIdAndKnowId(String studentId, String planId, String knowId);

    Long countByPlanIdAndKnowId(String planId, String knowId);

    YxyHuixuePlanKnowTrain findTopByPlanIdAndKnowId(String planId, String knowId);

}
